
/*****************************************************************************************************************************************************************

1) This file calls all of the do files to generate the estimates for "The World is not yet flat: Transport costs matter" in The Review of Economics and Statitics,
   including the main text and on-line appendix.
   
2) A separte data dictionary describes the variables. 

3) The panel dataset from which all estimates are made is generated by kb_master (//mead03/browmar$/kris_behrens/), which calls a set of SAS sub-rountines to 
   generate the LHS and RHS variables, as well ass LHS descriptive stats (Table 5 in the on-line appendix). These files are kept on a separte server, because they
   contain sensitive firm-level microdata.
   
4) All files are run using Stata 13, unless otherwise specified.

******************************************************************************************************************************************************************/



*Initial data preparation

do \\ead02\ead_uquam\Localization\restat_do\0_data_preparation.do

do \\ead02\ead_uquam\Localization\restat_do\1_data_preparation.do




*************
* Main text *
************* 

*Table 1

do \\ead02\ead_uquam\Localization\restat_do\2_dstats.do

*Figure 1a (1b is calcuated from a separate file as stated in the table notes)

do \\ead02\ead_uquam\Localization\restat_do\3_Figure1a.do

*Table 2

do \\ead02\ead_uquam\Localization\restat_do\4_cross.do
do \\ead02\ead_uquam\Localization\restat_do\5_cross_iv.do

*Table 3

do \\ead02\ead_uquam\Localization\restat_do\6_panel.do
do \\ead02\ead_uquam\Localization\restat_do\7_panel_iv.do




********************
* On-line appendix *
********************

*Table 4

do \\ead02\ead_uquam\Localization\restat_do\2_dstats.do

*Figure 2

do \\ead02\ead_uquam\Localization\restat_do\8_Figure_2

*Figure 3 (no data)

*Figure 4 

do \\ead02\ead_uquam\Localization\restat_do\9_Figure_4.do

*Figure 5 (no data)

*Figure 6

do \\ead02\ead_uquam\Localization\restat_do\10_Figure_6.do

*Tables 5, 6, 7 and 8

*Descriptive statistics for tables 5, 6, 7 and 8 are calculated in SAS (Version 9.3)

	*%include "\\mead03\browmar$\Kris_Behrens\lhs_dstat.sas"
	*(N.B.: This routine is called in kb_master.sas noted in point 2 above)
	*Released, confidentially vetted output can be found in \\mead03\browmar$\Kris_Behrens\kb_dstat_regout_for_vetting.xlsx


*Table 9 (based on publically available data CANSIM Table 282-0008 as stated in table notes)

*Figure 7

do \\ead02\ead_uquam\Localization\restat_do\2_dstats.do

*Table 10 

do \\ead02\ead_uquam\Localization\restat_do\2_dstats.do

*Table 11 (released confidentially vetted estimates)

*Table 12 

do \\ead02\ead_uquam\Localization\restat_do\11_cross_2008.do
do \\ead02\ead_uquam\Localization\restat_do\12_cross_2008_iv.do
	
*Table 13

	**Sales weighted
	do \\ead02\ead_uquam\Localization\restat_do\13_salesw.do

	**Employment weighted
	do \\ead02\ead_uquam\Localization\restat_do\14_empw.do

	**Unweighted, five year averages
	do \\ead02\ead_uquam\Localization\restat_do\15_5year.do

*Table 14

do \\ead02\ead_uquam\Localization\restat_do\16_industry.do

*Table 15

do \\ead02\ead_uquam\Localization\restat_do\17_geography.do

*Table 16

do \\ead02\ead_uquam\Localization\restat_do\18_distance.do

*Figure 8 

do \\ead02\ead_uquam\Localization\restat_do\19_window_cross.do
do \\ead02\ead_uquam\Localization\restat_do\20_window_panel.do

*Table 17

do \\ead02\ead_uquam\Localization\restat_do\21_trade.do

\\end
